package com.googlecode.rulio;

import com.googlecode.totallylazy.Predicate;

import java.util.Arrays;

public class ExecutionReport {
    public final Object action;
    public final Predicate predicate;
    public final Object[] results;
    public final boolean matched;
    public final boolean executed;
    public final Exception exception;

    public ExecutionReport(Object action, Predicate predicate, Object[] results, boolean matched, boolean executed, Exception exception) {
        this.action = action;
        this.predicate = predicate;
        this.matched = matched;
        this.executed = executed;
        this.results = results;
        this.exception = exception;
    }


    @Override
    public String toString() {
        return "ExecutionReport{" +
                "action=" + action +
                ", predicate=" + predicate +
                ", executed=" + executed +
                ", matched=" + matched +
                ", exception=" + exception +
                ", results=" + (results == null ? null : Arrays.asList(results)) +
                "}";
    }
}
